from atm_oop.user_class import User
from atm_oop.account_class import Account

class Menu:
    def __init__(self):
        self.user = User()
        self.account = Account()
    # 开始菜单
    def start_menu(self):
        tip = '''
    ********************* 欢迎来到蜗牛ATM *********************
    ********************** 请选择以下操作 *********************
    ****************** 1.注册  2.登录  3.退卡 *****************         
        '''
        print(tip)
        option = int(input("请输入你的选择："))
        if option == 1:
            self.user.reg()
        elif option == 2:
            self.user.login()
        else:
            exit("退卡成功")

    # 主菜单
    def main_menu(self):
        tip = '''
    ***************************** 进入蜗牛ATM主菜单 *****************************
    ****************************** 请选择以下操作 *******************************
    ******************* 1. 查询   2. 取款   3. 存款   4. 转账 *******************
    ****************** 5. 流水  6. 修改密码   7. 返回   8. 退卡 *****************     
            '''
        print(tip)
        option = int(input("请输入你的选择："))
        if option == 1:
            self.account.query()
        elif option == 2:
            self.account.withdraw()
        elif option == 3:
            self.account.deposite()
        elif option == 4:
            self.account.transer()
        elif option == 5:
            self.account.history()
        elif option == 6:
            self.user.update_pwd()
        elif option == 7:
            self.start_menu()
        else:
            exit('谢谢，欢迎下次光临.')


if __name__ == '__main__':
    Menu().start_menu()